/*
 * The MIT License
 *
 * Copyright 2015 chronosinfo.com.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 * Autor John Vanderson M Lima
 */

package com.chronos.pafecf.entidades;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author usuario
 */
@Entity
@Table(name = "ECF_FUNCIONARIO", catalog = "", schema = "")
@NamedQueries({
    @NamedQuery(name = "EcfFuncionario.findAll", query = "SELECT e FROM EcfFuncionario e")})
public class EcfFuncionario implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID", nullable = false)
    private Integer id;
    @Column(name = "NOME", length = 100)
    private String nome;
    @Column(name = "TELEFONE", length = 10)
    private String telefone;
    @Column(name = "CELULAR", length = 10)
    private String celular;
    @Column(name = "EMAIL", length = 250)
    private String email;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "COMISSAO_VISTA", precision = 18, scale = 6)
    private BigDecimal comissaoVista;
    @Column(name = "COMISSAO_PRAZO", precision = 18, scale = 6)
    private BigDecimal comissaoPrazo;
    @Column(name = "NIVEL_AUTORIZACAO")
    private Character nivelAutorizacao;
    @OneToMany(mappedBy = "idEcfFuncionario")
    private List<EcfVendaCabecalho> ecfVendaCabecalhoList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idEcfFuncionario")
    private List<NotaFiscalCabecalho> notaFiscalCabecalhoList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idEcfFuncionario")
    private List<EcfOperador> ecfOperadorList;

    public EcfFuncionario() {
    }

    public EcfFuncionario(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public String getTelefone() {
        return telefone;
    }

    public void setTelefone(String telefone) {
        this.telefone = telefone;
    }

    public String getCelular() {
        return celular;
    }

    public void setCelular(String celular) {
        this.celular = celular;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public BigDecimal getComissaoVista() {
        return comissaoVista;
    }

    public void setComissaoVista(BigDecimal comissaoVista) {
        this.comissaoVista = comissaoVista;
    }

    public BigDecimal getComissaoPrazo() {
        return comissaoPrazo;
    }

    public void setComissaoPrazo(BigDecimal comissaoPrazo) {
        this.comissaoPrazo = comissaoPrazo;
    }

    public Character getNivelAutorizacao() {
        return nivelAutorizacao;
    }

    public void setNivelAutorizacao(Character nivelAutorizacao) {
        this.nivelAutorizacao = nivelAutorizacao;
    }

    public List<EcfVendaCabecalho> getEcfVendaCabecalhoList() {
        return ecfVendaCabecalhoList;
    }

    public void setEcfVendaCabecalhoList(List<EcfVendaCabecalho> ecfVendaCabecalhoList) {
        this.ecfVendaCabecalhoList = ecfVendaCabecalhoList;
    }

    public List<NotaFiscalCabecalho> getNotaFiscalCabecalhoList() {
        return notaFiscalCabecalhoList;
    }

    public void setNotaFiscalCabecalhoList(List<NotaFiscalCabecalho> notaFiscalCabecalhoList) {
        this.notaFiscalCabecalhoList = notaFiscalCabecalhoList;
    }

    public List<EcfOperador> getEcfOperadorList() {
        return ecfOperadorList;
    }

    public void setEcfOperadorList(List<EcfOperador> ecfOperadorList) {
        this.ecfOperadorList = ecfOperadorList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EcfFuncionario)) {
            return false;
        }
        EcfFuncionario other = (EcfFuncionario) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.chronos.pafecf.entidades.EcfFuncionario[ id=" + id + " ]";
    }
    
}
